/*
 *  Copyright 2007 Blandware (http://www.blandware.com)
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.blandware.atleap.webapp.util.core;

/**
 * <p>Holds info about tile list component.</p>
 * <p><a href="TileListComponentInfo.java.html"><i>View source</i></a></p>
 *
 * @author Roman Puchkovskiy <a href="mailto:roman.puchkovskiy@blandware.com">
 *         &lt;roman.puchkovskiy@blandware.com&gt;</a>
 * @version $Revision: 1.2 $ $Date: 2007/04/10 12:12:12 $
 */
public class TileListComponentInfo {
    /**
     * List component name
     */
    protected String name;
    /**
     * List component description
     */
    protected String description;
    /**
     * Whether component is copyable
     */
    protected boolean copyable;

    /**
     * Default constructor.
     */
    public TileListComponentInfo() {
    }

    /**
     * Constructs new instance and initializes its name and description.
     *
     * @param name name to set
     * @param description description to set
     * @param copyable whether component is copyable
     */
    public TileListComponentInfo(String name, String description,
                                 boolean copyable) {
        this.name = name;
        this.description = description;
        this.copyable = copyable;
    }

    /**
     * Returns name.
     *
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * Sets name.
     *
     * @param name name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Returns description.
     *
     * @return description
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets description.
     *
     * @param description description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * Returns full description: description plus info about copyability.
     *
     * @return full description
     */
    public String getFullDescription() {
        return (isCopyable() ? "" : "*") + getDescription();
    }

    /**
     * Returns whether component is copyable.
     *
     * @return true if copyable
     */
    public boolean isCopyable() {
        return copyable;
    }

    /**
     * Sets whether component is copyable.
     *
     * @param copyable value to set
     */
    public void setCopyable(boolean copyable) {
        this.copyable = copyable;
    }
}
